package schedule.model;

import java.util.ArrayList;

public class Advisor {

	public int id;
	public ArrayList<inputTime> availableTimes;
	public milTimeSchedule milTime;
	public booleanSchedule boolTime;
	public Advisor(int id){
		this.id = id;
	}
	public void addTime(inputTime newTime){
		availableTimes.add(newTime);
	}
	public void createSchedules(){
		createMyMilTime();	
	}
	private void createMyMilTime(){
		milTimeSchedule mine = new milTimeSchedule();
		//appends hr and min together, as milTimeSchedule expects. i.e. sHr= 10 sMin= 45 turns into 1045
		for (inputTime a: availableTimes){
			StringBuffer sBuffer= new StringBuffer();
			sBuffer.append(a.startHr);
			sBuffer.append(a.startMn);
			int startTime = Integer.parseInt(sBuffer.toString());
			sBuffer.delete(0, sBuffer.length());
			sBuffer.append(a.endHr);
			sBuffer.append(a.endMn);
			int endTime = Integer.parseInt(sBuffer.toString());						
			mine.setAvailable(startTime, endTime);
		}
		milTime = mine;
	}
}
